REM  SQL scripts for Chapter 11 of ORACLE8 DBA Handbook by Kevin Loney.
REM  See www.osborne.com for updates to these scripts.


alter procedure APPOWNER.ADD_CLIENT compile;
execute DBMS_SHARED_POOL.KEEP('APPOWNER.ADD_CLIENT','P');

select Owner,
       Name,
       Type,
 Source_Size+Code_Size+Parsed_Size+Error_Size  Total_Bytes
  from DBA_OBJECT_SIZE
 where Type in ('PACKAGE BODY','PROCEDURE')
 order by 4 desc;


imp system/manager file=export.dmp rows=N
imp system/manager file=export.dmp full=y buffer=64000 commit=Y ignore=Y

create tablespace TEMP_GL
datafile '/db01/oracle/FIN/temp_gl.dbf' size 100m
default storage
(initial 5m next 5m pctincrease 0);

alter user GL temporary tablespace TEMP_GL;

select
   Extents,  /*how many extents does the segment have?*/
   Bytes,    /*how large is the temp segment, in bytes? */
   Blocks    /*how large is it, in Oracle blocks? */
from DBA_SEGMENTS
where Segment_Type = 'TEMPORARY'
  and Tablespace_Name = 'TEMP_GL';


svrmgrl
SVRMGR> connect internal;
SVRMGR> grant select on V$PROCESS to applsys with grant option;
SVRMGR> grant select on V$SESSION to applsys with grant option;
SVRMGR> grant select on V$PROCESS to public;
SVRMGR> grant select on V$SESSION to public;

create table EXTRACT_TABLE
as select * from REP_TABLE;

select Name
  from PROSPECT
 where Name like 'B%'
   and contains (Resume, 'digging') > 0;

ctxsrv -user ctxsys/ctxsys_pass -personality QDML

column Ser_Name format A32

select Ser_Name,
       Ser_Status,
       Set_Started_At
from CTX_ALL_SERVERS;

execute CTX_ADM.SHUTDOWN;

execute CTX_ADM.SHUTDOWN('DRSRV_42736');

select Owner,         /*Owner of the index*/
       Index_Name,    /*Name of the index*/
       Status         /*Either DIRECT PATH or VALID*/
  from DBA_INDEXES;




